import socket

# 创建连接对象
client_server = socket.socket()

#连接服务器
client_server.connect(('127.0.0.1', 5555))

# 发送数据
client_server.send('client send data'.encode('utf-8'))

# 接收服务端的返回数据
data = client_server.recv(1024)
print(data.decode('utf-8'))

#关闭连接
client_server.close()
# data = client_server.recv(1024)


